package user_wash

import (
	"context"

	"gitee.com/liuxuezhan/ar-platform/rpc-client/assetsClient/rpc"

	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/svc"
	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type UserWashDescUpdateStatusLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

// 洗码描述--修改状态
func NewUserWashDescUpdateStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserWashDescUpdateStatusLogic {
	return &UserWashDescUpdateStatusLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *UserWashDescUpdateStatusLogic) UserWashDescUpdateStatus(req *types.UserWashDescUpdateStatusRequest) (resp *types.UserWashDescUpdateStatusResponse, err error) {
	updateStatusRequest := &rpc.UpdateStatusRequest{
		Id:     req.Id,
		Status: req.Status,
	}
	if _, err = l.svcCtx.AssetsRpc.UserWash.UpdateStatus(l.ctx, updateStatusRequest); err != nil {
		return nil, err
	}
	return &types.UserWashDescUpdateStatusResponse{}, nil
}
